Translator diagnostics

When you compile code one of two things will happen.

  1. You will get a build succeeded message
  2. You will get a list of nasty syntax errors

This report is known as translator diagnostics. In the first situation it will tell you if the build succeeded. You will not be able to execute the code unless the build succeeded. The second one will help you find and remove the error.

The error report which is generated by the translator is very structured. It is designed to allow the programmer to easily find and solve the problem. In the example to the right (click to see the full size image) you can see the main elements of the error report -

Example Diagnostics

  1. Build failed message
  2. Type of the error
  3. Line number of error
  4. Source file of error

This information should be enough to find and solve the problem. As sometimes there may be more than one source code file in the system you will need to know which file has the problem. Secondally you need to know where in the file the problem is. Finally you will need to know the type of the error. Commonly in IDE's if you click on the error it will take you striaght there.

Although the error reports are fairly accurate (they have improved a lot over the years!) they may not always get it right. The programmer must treat the error reports as suggestions to what the problem is not actual truth. Read the section on spotting errors to see what the common errors are.